#ifndef VOLUMEINFO_H
#define VOLUMEINFO_H

#include "planeInfo.h"

struct DICOMStruct;
/////////////////////////////////////////////////////
// TVolumeInfo //////////////////////////////////////
/////////////////////////////////////////////////////
class TVolumeInfo
{
public:
	TVolumeInfo( const QList<DICOMStruct*> &dcmList );
	//
	void setDcmSerie( const QList<DICOMStruct*> &dcmList );
	//
	void completePlane( TPlaneInfo &plane ) const;
	//
	const QVector3D &pos()		const	{ return m_ptBeg; }
	const QVector3D &vecWidth()	const	{ return m_vecWidth; }
	const QVector3D &vecHeight()const	{ return m_vecHeight; }
	const QVector3D &vecDepth()	const	{ return m_vecDepth; }
	float width()	const	{ return m_width; }
	float height()	const	{ return m_height; }
	float depth()	const	{ return m_depth; }

private:
	struct TVolumePlane
	{
		TVolumePlane(){}
		TVolumePlane( QVector3D point, QVector3D normal ):p(point), n(normal) {}
		//
		QVector3D p, n;
	};
	//
	void makePlanes();
	void getHeightBounds( float &heightUp, float &heightDown
						, const QVector3D &point, const QVector3D &vec ) const;
	QVector3D interseptWithVolumePlane( const QVector3D &p, const QVector3D &v
								 , const TVolumePlane &plane ) const;
	//
	QVector3D m_ptBeg;//, ptEnd;
	QVector3D m_vecWidth, m_vecHeight, m_vecDepth;
	float m_width, m_height, m_depth;
	QVector<TVolumePlane> m_planes;
};


#endif //VOLUMEINFO_H